import fs from 'fs';
const symbolMap: Record<string, string> = JSON.parse(fs.readFileSync('C:/Users/Administrator/Desktop/build.js.symbols.json', 'utf-8'));
const input = fs.readFileSync('tmp/input.log', 'utf-8');

const output = input.replace(/(?<=\(anonymous\) @ \w+-)\d+(?=:\d+)/g, (s) => {
    return symbolMap[s] ?? s;
}).replace(/(?<=wasm-function\[)\d+(?=])/g, (s) => {
    return symbolMap[s] ?? s;
});

fs.writeFileSync('tmp/output.log', output, 'utf-8');
